import { setupMutationObserver } from "./changeInterceptor";
import { initCleanup } from "./cleaner";
import { injectCSS } from "./cssInjector";
import { setupDOMInterceptor } from "./domInterceptor";
import { logInitialization } from "./logger";



export class MoreConcisePage {
  constructor(options) {
    this.name = options.name || 'More Concise Page';
    this.selectors = options.selectors || [];
    this.css = options.css || '';
    this.log = options.log || false;

    // 设置日志是否开启
    logInitialization(this.log, this.name);

    // CSS注入
    injectCSS(this.css);

    // 设置DOM原型方法拦截
    setupDOMInterceptor(this.selectors);

    // 执行初始清理
    initCleanup(this.selectors);

    // 设置MutationObserver
    setupMutationObserver(this.selectors);
  }
}